import wx
""" Create many panels with a button
However, with more than one panel the frams doesn't close properly"""
class FrameWithButton(wx.Frame):
    def __init__(self, number_of_panels=1):
        wx.Frame.__init__(self,None,-1,"Frame subclass",size=(500,500))
        self.panels=[]
        for i in range(0, number_of_panels):
            self.panels.append(wx.Panel(self, -1,size=(90,90),pos=(90*i,90*i)))
            self.buttons=[]
        for i in range(0, number_of_panels):
            self.buttons.append( wx.Button(self.panels[i],-1,"Ignore me"))
class App(wx.App):
    def OnInit(self):
        self.frame = FrameWithButton(2) #Here's where the frame gets instantiaded
        self.frame.Show()
        self.SetTopWindow(self.frame)
        return True

if "__main__" == __name__:
    app = App()
    app.MainLoop()